﻿//using System.Collections.Generic;
//using System.Dynamic;
//using MetaDrive.Linq.Wadl;
//using Microsoft.VisualStudio.TestTools.UnitTesting;
//using Newtonsoft.Json.Linq;

//namespace Neo4jConnect.Test
//{
//    [TestClass]
//    public class JsonTest : TestBase
//    {
//        public abstract class EntityBase : DynamicObject
//        {
//            public override IEnumerable<string> GetDynamicMemberNames()
//            {
//                yield return "name";
//            }

//            public override bool TryInvoke(InvokeBinder binder, object[] args, out object result)
//            {
//                return base.TryInvoke(binder, args, out result);
//            }

//            public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
//            {
//                return base.TryInvokeMember(binder, args, out result);
//            }

//            Dictionary<string, object> _propertyBag;
//            public object this[string propertyName]
//            {
//                get
//                {   //Code to check typed properties,if exists return that value
//                    return _propertyBag[propertyName];
//                }
//                set
//                {   //Code to check typed properties,if exists set that property
//                    _propertyBag[propertyName] = value;
//                }
//            }

//            public override bool TryGetMember(GetMemberBinder binder, out object result)
//            {   //Code to check typed properties,if exists return that value
//                return _propertyBag.TryGetValue(binder.Name, out result);
//            }

//            public override bool TrySetMember(SetMemberBinder binder, object value)
//            {   //Code to check typed properties,if exists set that property
//                _propertyBag[binder.Name] = value;
//                return true;
//            }
//        }


//        public class MyObject : EntityBase
//        {            
//            public string name { get; set; }

//            public override IEnumerable<string> GetDynamicMemberNames()
//            {
//                yield return "name";
//            }

//            public override bool TryGetMember(GetMemberBinder binder, out object result)
//            {
//                result = null;
//                return true;
//            }

//            public override bool TrySetMember(SetMemberBinder binder, object value)
//            {
//                return true;
//            }
//        }

//        [TestMethod]
//        public void Test01()
//        {
            
            

//            var y = @"C:\Users\Me\Desktop\AmazonItemSearch.txt";
//            var u = @"X:\Dropbox\MySource\CodePlex\Neo4jConnect\src\Neo4jConnect\Rest\application.wadl";

//            var f = WadlReader.Read(u);

//            string someJson = @"{
//                ""outgoing_relationships"" : ""http://localhost:7474/db/data/node/3/relationships/out"",
//                ""data"" : {
//                ""name"" : ""Trinity""
//                },
//                ""traverse"" : ""http://localhost:7474/db/data/node/3/traverse/{returnType}"",
//                ""all_typed_relationships"" : ""http://localhost:7474/db/data/node/3/relationships/all/{-list|&|types}"",
//                ""property"" : ""http://localhost:7474/db/data/node/3/properties/{key}"",
//                ""self"" : ""http://localhost:7474/db/data/node/3"",
//                ""properties"" : ""http://localhost:7474/db/data/node/3/properties"",
//                ""outgoing_typed_relationships"" : ""http://localhost:7474/db/data/node/3/relationships/out/{-list|&|types}"",
//                ""incoming_relationships"" : ""http://localhost:7474/db/data/node/3/relationships/in"",
//                ""extensions"" : {
//                    ""ShortestPath"" : {
//                        ""shortestPath"" : ""http://localhost:7474/db/data/ext/ShortestPath/node/3/shortestPath""
//                    },
//                    ""DepthTwo"" : {
//                        ""nodesOnDepthTwo"" : ""http://localhost:7474/db/data/ext/DepthTwo/node/3/nodesOnDepthTwo"",
//                        ""relationshipsOnDepthTwo"" : ""http://localhost:7474/db/data/ext/DepthTwo/node/3/relationshipsOnDepthTwo"",
//                        ""pathsOnDepthTwo"" : ""http://localhost:7474/db/data/ext/DepthTwo/node/3/pathsOnDepthTwo""
//                        }
//                },
//                ""create_relationship"" : ""http://localhost:7474/db/data/node/3/relationships"",
//                ""all_relationships"" : ""http://localhost:7474/db/data/node/3/relationships/all"",
//                ""incoming_typed_relationships"" : ""http://localhost:7474/db/data/node/3/relationships/in/{-list|&|types}""
//                }";

//            var jsonObject = JObject.Parse(someJson);

            

//            dynamic myObject = new MyObject();
//            //myObject.polleke = "fdihfudh";
//            myObject.name = "kdfkdj";


//            //JsonConvert.PopulateObject(jsonObject["data"].ToString(), myObject);
            
//            //dynamic myobject = JsonConvert.DeserializeObject<MyObject>(jsonObject["data"].ToString());

            
//        }        
//    }
//}
